<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flat与flatMap</title>
</head>
<body>
    <script>
        let arr = [123,456,[123,456],[[1234]]];
        arr = arr.flat(1);
       for(el of arr)
       {
        console.log(el);
       }
       arr = arr.flat(1);
      for(el of arr)
       {
        console.log(el);
       }

       let message = ["hello world","你好 世界","我靠 哈啊哈哈"];
       message =  message.flatMap((item)=>{ return item.split(" ")});
       console.log(message);

    </script>
</body>
</html>